<template>
  <div class="params-info" v-if="Object.keys(itemParams).length !== 0">
    <div class="params-key">{{itemParams.rule.key}}</div>
    <table class="info-size">
      <tr v-for="tr in itemParams.rule.tables[0]">
        <td v-for="td in tr">{{td}}</td>
      </tr>
    </table>
    <div class="params-key">{{itemParams.info.key}}</div>
    <table class="info-params">
      <tr v-for="tr in itemParams.info.set">
        <td class="info-params-key">{{tr.key}}</td>
        <td class="params-value">{{tr.value}}</td>
      </tr>
    </table>
    <div class="info-img" v-if="itemParams.info.images">
      <img :src="itemParams.info.images[0]" alt="">
    </div>
  </div>
</template>

<script>
  export default {
    name: "DetailParamsInfo",
    props: {
      itemParams: {
        type: Object,
        default(){
          return {}
        }
      }
    }
  }
</script>

<style scoped>
.params-info{
  padding: 20px 15px;
  font-size: 14px;
  border-bottom: 5px;
  border-bottom: 6px solid #eee;
}
.params-key{
  color: #333;
  font-size: 15px;
  padding-bottom: 10px;
}
.info-size{
  margin-bottom: 30px;
}
.params-info table{
  width: 100%;
  border-collapse: collapse;
}
.params-info table tr{
  height: 42px;
}
.params-info table tr td{
  border-bottom: 1px solid rgba(100, 100, 100, .1);
}
.info-params-key{
  width: 95px;
}
.params-value{
  color: #eb4868;
}
.info-img img{
  width: 100%;
}
</style>